/* eslint-disable */
import request from "@/request";

/** 检查库存 GET /api/api/shopPart/product/${param0}/stock */
export async function checkStockUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.checkStockUsingGETParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponseBoolean_>(
    `/api/api/shopPart/product/${param0}/stock`,
    {
      method: "GET",
      params: {
        ...queryParams,
      },
      ...(options || {}),
    }
  );
}

/** 创建商品 POST /api/api/shopPart/product/create */
export async function createProductUsingPost(
  body: API.ClothingProduct,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseLong_>("/api/api/shopPart/product/create", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除商品 POST /api/api/shopPart/product/delete */
export async function deleteProductUsingPost(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteProductUsingPOSTParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>("/api/api/shopPart/product/delete", {
    method: "POST",
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 获取商品详情 GET /api/api/shopPart/product/get */
export async function getProductUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getProductUsingGETParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseClothingProduct_>(
    "/api/api/shopPart/product/get",
    {
      method: "GET",
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 获取商品库存详情 GET /api/api/shopPart/product/getsizeStocks */
export async function getProductsizeStocksUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getProductsizeStocksUsingGETParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseListSizeStock_>(
    "/api/api/shopPart/product/getsizeStocks",
    {
      method: "GET",
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 分页获取商品列表 POST /api/api/shopPart/product/list */
export async function listProductsUsingPost(
  body: API.ProductQueryRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageClothingProduct_>(
    "/api/api/shopPart/product/list",
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      data: body,
      ...(options || {}),
    }
  );
}

/** 更新商品尺码库存 POST /api/api/shopPart/product/sizeStock/update */
export async function updateSizeStockUsingPost(
  body: API.UpdateSizeStockRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>(
    "/api/api/shopPart/product/sizeStock/update",
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      data: body,
      ...(options || {}),
    }
  );
}

/** 分页获取店铺商品列表 POST /api/api/shopPart/product/store/list */
export async function listStoreProductsUsingPost(
  body: API.StoreProductQueryRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageClothingProduct_>(
    "/api/api/shopPart/product/store/list",
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      data: body,
      ...(options || {}),
    }
  );
}

/** 获取店铺所有商品详情 POST /api/api/shopPart/product/store/products */
export async function getStoreProductsUsingPost(
  body: API.StoreProductQueryRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageClothingProduct_>(
    "/api/api/shopPart/product/store/products",
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      data: body,
      ...(options || {}),
    }
  );
}

/** 更新商品 POST /api/api/shopPart/product/update */
export async function updateProductUsingPost(
  body: API.ClothingProduct,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>("/api/api/shopPart/product/update", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}
